package com.exp.bookhouse.pojo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;

@ApiModel("书籍分类实体类Category")
@TableName("tb_category")
public class Category implements Serializable {

    @ApiModelProperty(value = "分类id")
    @TableId(type = IdType.AUTO)  //主键自增
    private Long id;

    @ApiModelProperty(value = "分类名称")
    private String name;    //分类名称

    @ApiModelProperty(value = "优先级，越大优先级越高，默认：0")
    private Integer priority;   //优先级，越大优先级越高，默认：0

    @ApiModelProperty(value = "创建时间",hidden = true)
    @TableField(fill= FieldFill.INSERT)
    private Date createTime;    //创建时间

    @ApiModelProperty(value = "更新时间",hidden = true)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;    //更新时间

    public Category() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "Category{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", priority=" + priority +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
